package com.bawei.module_classify.mvp

import com.bawei.library_base.manager.MyManager
import io.reactivex.Observer
import io.reactivex.Scheduler
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * @date : 2021/12/14
 * @author : zhiyu
 * @content :
 */
class GoodsModel:GoodContract.GoodModel {
    override fun getGoods(observer: Observer<Goods>,id:Int) {
        MyManager.getInstance().getRetrofit("http://82.156.178.182:8082")
            .create(Api::class.java)
            .getGoods(id)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(observer)

    }

    override fun destroy() {

    }
}